package com.anteater.eattheant;

import android.app.Activity;
import android.content.Intent;
import android.media.AudioManager;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import com.anteater.eattheant.util.SoundPlayer;

public class EatTheAnt extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                        WindowManager.LayoutParams.FLAG_FULLSCREEN);
		
		setContentView(R.layout.main);
		
		// Permite que o controlador de volume do celular tb controle o volume do aplicativo
		setVolumeControlStream(AudioManager.STREAM_MUSIC);
	}
	
	@Override
	protected void onStart() {
		super.onStart();
		SoundPlayer.getInstance().playInBackground(this, R.raw.background2);
	}
	
	@Override
	public void onBackPressed() {
		SoundPlayer.getInstance().stopSounds();
		finish();
	}

	public void play(View view) {
		SoundPlayer.getInstance().playSound(this, R.raw.clique_botao3);
		startActivity(new Intent(this, PlayActivity.class));
	}
	
	public void levels(View view) {
		SoundPlayer.getInstance().quickSound(this, R.raw.clique_botao3);
		startActivity(new Intent(this, LevelActivity.class));
	}
	
	public void options(View view) {
		SoundPlayer.getInstance().quickSound(this, R.raw.clique_botao3);
		startActivity(new Intent(this, OptionsActivity.class));
	}
	
	public void quit(View view) {
		//TODO procurar um som para sair do jogo
		SoundPlayer.getInstance().quickSound(this, R.raw.clique_botao);
		SoundPlayer.getInstance().stopSounds();
		finish();
	}
}
